package com.yuntsg.subject_database.controller;

import com.yuntsg.subject_database.component.SubjectDatabaseComponent;
import com.yuntsg.subject_database.entity.PublicEntity;
import com.yuntsg.subject_database.servic.SubjectDatabaseService;
import com.yuntsg.subject_database.servic.UpDataCorePaperUnite;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

//import com.yuntsg.subject_database.entity.CorePaperUnite30W;
//import com.yuntsg.subject_database.servic.UpDataCorePaperUnite30W;

@RestController
public class SubjectDatabaseController {


    @Resource
    SubjectDatabaseService subjectDatabaseService;
    @Resource
    private UpDataCorePaperUnite upDataCorePaperUnite;


    //    @Data
//    public static class SearchEntity {
//        private List<String> ads = new ArrayList<>();
//        private List<String> jourids = new ArrayList<>();
//        private String specialist = "";
//        private String code = "";
//    }
    @RequestMapping("/essearch")
    public List<Integer> esSearch(@RequestBody PublicEntity.SearchEntity searchEntity) throws Exception {
//    @Data
//    public static class PostInfo {
//        private String specialist = "";
//        private String code = "";
//        private List<Object> list = new ArrayList<>();
//    }
        List<Integer> list = new ArrayList<>();

//        return subjectDatabaseService.insertTableSearch(searchEntity);
        return list;
    }

    @RequestMapping("/homesearch")
    public Object homeSearch(PublicEntity.SearchEntity searchEntity) throws Exception {
        return subjectDatabaseService.homeSearch(searchEntity);
    }


    // pm  2022年6月29日10:30:03 专用
    @RequestMapping("/homesearch-pm")
    public Object homeSearchPm(PublicEntity.SearchEntity searchEntity) throws Exception {
        return subjectDatabaseService.homeSearchPm(searchEntity);
    }


    @RequestMapping("/homesearch-auth")
    public Object homesearchAuth(PublicEntity.SearchEntity searchEntity) throws Exception {
        return subjectDatabaseService.authSearch(searchEntity);
    }

    @RequestMapping("/homesearch-unit")
    public Object homesearchUnit(PublicEntity.SearchEntity searchEntity) throws Exception {
        return subjectDatabaseService.unitSearch(searchEntity);
    }


    // pm专用 获取大学
    @RequestMapping("/homesearch-unit-pm")
    public Object homesearchUnitPm(PublicEntity.SearchEntity searchEntity) throws Exception {
        return subjectDatabaseService.unitSearchPm(searchEntity);
    }


}
